package com.liu.cloud.common.entitys;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor

public class Result<T> {

    private Integer code;
    private String message;
    private  T  data;

    public Result(Integer code, String message) {
        this(code,message,null);

    }



    public static <T> Result  getSuccess(String message,T t){
        return new Result(200,message,t);
    }

    public static  Result  getSuccess(String message){
        return new Result(200,message,null);
    }

    public static <T> Result getFaild(String message,T t){
         return  new Result(500,message,t);
    }
    public static <T> Result getFaild(String message){
        return  new Result(500,message);
    }
}
